Skip to content

chore(versions): update Python version support to 3.10+ in gapic-generator#16910

Merged
chalmerlowe merged 52 commits intomainfrom
feat/gapic-version-fixes
May 4, 2026
Merged

chore(versions): update Python version support to 3.10+ in gapic-generator#16910
chalmerlowe merged 52 commits intomainfrom
feat/gapic-version-fixes

Conversation

@chalmerlowe
Copy link
Copy Markdown
Contributor

@chalmerlowe chalmerlowe commented May 1, 2026

Note

This PR has been updated to remove 3.7, 3.8, and 3.9 (with one exception discussed below).

Overview

This Pull Request updates the gapic-generator package and related CI configurations to reflect the deprecation of Python 3.7 through 3.9. It updates documentation, templates, and CI scripts to establish Python 3.10 as the new minimum supported version where applicable.

Changes

Documentation:

  • Updated installation and verification instructions in packages/gapic-generator/docs to reference Python 3.10

Templates:

  • Updated init.py.j2 templates in gapic/ads-templates to require Python 3.10+ (updating sys.version_info checks and error messages).
  • Removed outdated comments regarding Python 3.9 and below features (like module-level getattr) to avoid confusion, as the baseline runtime is now higher than the version noted in the comments.
  • Updated mypy.ini.j2 to target Python 3.10.
  • Cleaned up dead code (e.g. commented-out Jinja snippets) in the templates.

CI Configurations:

  • Removed Python 3.9 and below from the unit test matrix in ci/run_single_test.sh.
  • Updated comments regarding supported Python versions in ci/run_conditional_tests.sh.

Reasoning

Python 3.9 and below have reached End-of-Life (EOL) and are no longer supported. These changes ensure that our generator and the libraries it produces align with current support policies and reduce maintenance burden by removing dead code paths.

Note

because the config that runs this PR checks is not updated yet, it still wants to run 3.9 so we have a temp change to skip that nox session. Once this PR merges future PRs will no longer attempt to run 3.9 and we will follow-up with a small PR to strip out that last 3.9 reference.

Fixes internal issue: http://b/482126936 🦕

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes support for Python 3.7 across the repository, updating documentation, CI scripts, and generator templates to reflect a minimum requirement of Python 3.8. Feedback was provided to ensure consistency between CI scripts by including Python 3.13 in the list of supported versions within the comments of ci/run_conditional_tests.sh.

Comment thread ci/run_conditional_tests.sh Outdated
Comment thread ci/run_conditional_tests.sh Outdated
Comment thread packages/gapic-generator/docs/getting-started/_verifying.rst Outdated
@parthea parthea changed the title chore(versions): update Python version support to 3.8+ in gapic-generator chore(versions): update Python version support to 3.9+ in gapic-generator May 1, 2026
@parthea parthea marked this pull request as draft May 1, 2026 16:38
@parthea parthea changed the title chore(versions): update Python version support to 3.9+ in gapic-generator chore(versions): update Python version support to 3.10+ in gapic-generator May 1, 2026
@chalmerlowe chalmerlowe force-pushed the feat/gapic-version-fixes branch from a73f347 to 9a6dece Compare May 1, 2026 17:30
chalmerlowe added 25 commits May 4, 2026 07:51
@parthea parthea marked this pull request as ready for review May 4, 2026 15:36
@chalmerlowe chalmerlowe merged commit 6d68146 into main May 4, 2026
87 checks passed
@chalmerlowe chalmerlowe deleted the feat/gapic-version-fixes branch May 4, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants